#ifndef POSETS_H
#define POSETS_H

#include <stdio.h>
#include <stdlib.h>

#include "dlllists.h" 

#define POSET_NAME_MAX_LEN 100
#define POSET_NAME_DIM ((POSET_NAME_MAX_LEN) + 1)

/** A poset is a topologically sorted list of subsets with a name. */

typedef List Listofsss;

typedef struct poset
{
  char name[POSET_NAME_DIM];
  Listofsss sss;
} Poset;


/** Operations **/

extern void
poset_set_name(char *name, Poset *p);

extern void 
poset_free(Poset *p);

extern int
poset_belongs(Subset s, Poset * p);

extern void
poset_ts_add_el(El element, Poset * poset);

extern Poset *
poset_tsort_of(Poset *poset);

/* Create the dual poset by complementing each element */ 
extern Poset *
poset_opposite_of(Poset *p, char *s);

extern void
poset_force_opposite(Poset *p);

extern void
poset_opposite_leavename(Poset *p);

Listofsss
poset_uppercovers_of(El s, Listofsss p);

/*  Printing Stuff */
void
poset_print_latdraw(Poset *p);

#endif /*  POSETS_H */






























